﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;
using System.Windows.Forms;

namespace IDE_Week_2
{
    public partial class Form1 : Form
    {
        string mylang = "en";

        public Form1() 
        {
            InitializeComponent();
        }
        private void ChangeLanguage(string lang) //method
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

      
        private void openNewform_Click(object sender, EventArgs e)
        {
            (new Form2()).Show();
        }

        private void changeIcon_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Icon1;
        }

        private void resetIcon_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }

        private void changeLanguage_Click(object sender, EventArgs e)
        {

            if (mylang == "en")
            {
                ChangeLanguage("nl");
                mylang = "nl";
            }
            else
            {
                mylang = "en";
                ChangeLanguage("en");

            }

        }

        private void callClass1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            lb1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }
    }
}
